<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('审核列表')"/>
	<link rel="stylesheet" th:href="@{/static/scaletab/scaletabedit.css}"/>
</head>
<body style="background-color: white;">
<form class="layui-form" action=""  th:object="${combinedForm}"  >
    <div class="mainBox">
        <div class="main-container">
			<div class="centered-div">
			<table  id="scaletab-table"  lay-filter="scaletab-table" style='border-collapse:collapse;table-layout:fixed;width:766pt'>
				<col width=64 span=6 style='width:48pt'>

				<tr height=18  style='mso-height-source:userset;height:18.8pt'>
					<td colspan=5 height=18 class=xl6332418 style='height:13.8pt' th:text="'客户名称: ' + *{detection.customer}"/>
					<td colspan=6 class=xl6432418  th:text="'型号规格／测量范围: ' + *{detection.modelspecifications}"/>
					<td colspan=5 class=xl6432418   th:text="'任务单号: ' + *{detection.taskno}"/>
				</tr>
				<tr height=18 class="tr_height" style='mso-height-source:userset;height:24.8pt'>
					<td colspan=5 height=18 class=xl6332418 style='height:13.8pt'   th:text="'制造厂／商: ' + *{detection.manufacturer}"/>
					<td colspan=6 class=xl6432418  th:text="'准确度等级／MPE: ' + *{detection.mpe1}">
					</td>
					<td colspan=5 class=xl6432418  th:text="'出厂编号: ' + *{detection.exitnum}"/>
				</tr>
				<tr height=19 class="tr_height" style='mso-height-source:userset;height:24.8pt'>
					<td colspan=5 height=19 class=xl6332418 style='height:14.4pt'th:text="'主要标准器名称: ' + *{detection.mainstandard}"/>
					<td colspan=3 class=xl6432418 th:text="'测量范围: ' + *{detection.mrange}"/>
					<td colspan=5 class=xl6432418 th:text="'证书编号: ' + *{detection.certificateno}"/>
				</tr>
				<tr height=19 class="tr_height" style='height:24.8pt'>
					<td colspan=6 height=19 class=xl6332418 style='height:14.4pt' th:text="'标准砝码: ' + *{detection.smw}"/>
					<td colspan=8 class=xl6432418  th:text="'证书有效期至: ' + *{detection.certificateutil}"/>
				</tr>
				<tr height=19 class="tr_height" style='height:24.8pt'>
					<td height=19 class=xl6332418 colspan=3 style='height:14.4pt'>
						检定的环境条件:
					</td>
					<td colspan=2 class=xl6432418 th:text="'温度: ' + *{detection.temperature}+'℃'"/>
					<td colspan=2 class=xl6932418 th:text="'湿度: ' + *{detection.humidity}+'%RH'"/>
					<td colspan=3 class=xl6432418 th:text="'大气压力: ' + *{detection.atmospheric}+'hPa'"/>
					<td colspan=3 class=xl6932418  th:text="'空气密度: ' + *{detection.airdensity}+'mg/cm³'"/>
					<td colspan=3 class=xl6432418 th:text="'材料: ' + *{detection.stuff}"/>

				</tr>
				<tr height=19 class="tr_height" style='height:24.8pt'>
					<td colspan=7 height=19 class=xl6332418 style='height:14.4pt' th:text="'检定依据的技术文件: ' + *{detection.according}"/>
					<td colspan=5 class=xl6432418 th:text="'计量标准使用前工作状况: ' + *{detection.prework}"/>
					<td colspan=4 class=xl6432418 th:text="'计量标准使用后工作状况: ' + *{detection.afterwork}"/>
				</tr>
				<tr height=19 class="tr_height" style='height:24.8pt'>
					<td colspan=11 height=19 class=xl6332418 style='height:14.4pt' th:text="'检定项目: ' + *{detection.project}"/>
					<td colspan=6 class=xl6432418 th:text="'检定地点: ' + *{detection.inspectionsite}"/>
				</tr>

				<!-- --------------------------------------------------------------------------------------------------------------------------- -->
				<tr name="tab_header_one" class="tab_header " height=18 style='mso-height-source:userset;height:13.2pt'>
					<td rowspan=2 height=57 class=xl6532418 width=64 style='height:42.6pt;
								width:48pt'>
						检定顺序
					</td>
					<td rowspan=2 class=xl6532418 width=64 style='width:48pt'>
						名义质量（kg）
					</td>
					<td rowspan=2 class=xl6532418 width=64 style='width:48pt'>
						秤盘
					</td>
					<td rowspan=2 class=xl6532418 width=64 style='width:48pt'>
						读数1（mg）
					</td>
					<td rowspan=2 class=xl6532418 width=64 style='width:48pt'>
						读数2（mg）
					</td>
					<td rowspan=2 class=xl6532418 width=64 style='width:48pt'>
						平衡位置
					</td>
					<td rowspan=2 class=xl6532418 width=61 style='width:46pt'>
						分度值（mg）
					</td>
					<td rowspan=2 class=xl6532418 width=64 style='width:48pt'>
						相差质量（mg）
					</td>
					<td rowspan=2 class=xl6532418 width=64 style='width:48pt'>
						标准砝码约定质量修正值（mg）
					</td>
					<td rowspan=2 class=xl6532418 width=64 style='width:48pt'>
						空气浮力修正（mg）
					</td>
					<td colspan=2 class=xl6532418 width=128 style='border-left:none;width:96pt'>
						约定质量（mg）
					</td>
					<td colspan=2 class=xl6532418 width=128 style='border-left:none;width:96pt'>
						磁化率
					</td>
					<td colspan=2 class=xl6532418 width=128 style='border-left:none;width:96pt'>
						极化强度（μΤ）
					</td>
				</tr>
				<tr name="tab_header_two"  class="tab_header " height=39 style='height:29.4pt'>
					<td height=39 class=xl6532418 width=64 style='height:29.4pt;border-top:none;
								border-left:none;width:48pt'>
						修正值
					</td>
					<td class=xl6532418 width=64 style='border-top:none;border-left:none;
								width:48pt'>
						允差（±）
					</td>
					<td class=xl6532418 width=64 style='border-top:none;border-left:none;
								width:48pt'>
						读数
					</td>
					<td class=xl6532418 width=64 style='border-top:none;border-left:none;
								width:48pt'>
						允差（±）
					</td>
					<td class=xl6532418 width=64 style='border-top:none;border-left:none;
								width:48pt'>
						读数
					</td>
					<td class=xl6532418 width=64 style='border-top:none;border-left:none;
								width:48pt'>
						允差（±）
					</td>
				</tr>
				<tr name="tr_first" class="tr_abba" height=20 style='height:15.0pt'>

					<td rowspan=4 height=80 class=xl6532418 width=64 style='height:60.0pt;
								border-top:none;width:48pt'>
						1
					</td>
					<td rowspan=4 class=xl6532418 width=64 style='border-top:none;width:48pt' th:text="*{detection.smw}" />
						　

					<td class=xl6632418 width=64 style='border-top:none;border-left:none;
								width:48pt'>
						A
					</td>
					<td  id="read11"  class=xl6532418  width=64 style='border-top:none;border-left:none;
								width:48pt'>
					</td>
					<td id="read21" class=xl6532418  width=64 style='border-top:none;border-left:none;
								width:48pt'>
					</td>
					<td class=xl6532418 width=64 style='border-top:none;border-left:none;
								width:48pt'>
						　
					</td>
					<!--分度值-->
					<td id="division" rowspan=4 class=xl6532418 width=61 style='border-top:none;width:46pt'>
						1
					</td>
					<!--相差质量-->
					<td rowspan=4 class=xl6532418  th:text="*{scaletab.differMass}"   width=64 style='border-top:none;width:48pt'>
					</td>
					<!--标准砝码约定质量修正值-->
					<td id="standardWeightCorrected" th:text="*{scaletab.standardWeightCorrected}" rowspan=4 class=xl6532418  width=64 style='border-top:none;width:48pt'>

					</td>
					<!-- 空气浮力修正值-->
					<td rowspan=4 class=xl6532418  id="airCorrected" th:text="*{scaletab.airCorrected}" width=64 style='border-top:none;width:48pt'>
					</td>
					<td rowspan=4  id="massCorrected"  th:text="*{scaletab.massCorrected}" class=xl6532418 width=64 style='border-top:none;width:48pt' >
						<!-- 约定质量修正值-->
					</td>
					<td id="magneticTolerance" rowspan=4  th:text="*{scaletab.magneticTolerance}" class=xl6532418  width=64 style='border-top:none;width:48pt'>
					</td>
					<!-- 注释内容 约定值允差-->
					<td id="magneticReads" rowspan=4 class=xl6532418  width=64 style='border-top:none;width:48pt'  th:text="*{scaletab.magneticReads}" >
					</td>
					<td id="massTolerance"  rowspan=4 class=xl6532418 width=64 style='border-top:none;width:48pt' th:text="*{scaletab.massTolerance}">
					</td>
					<td  id="polarizationReads" rowspan=4 class=xl6532418 width=64 style='border-top:none;width:48pt'th:text="*{scaletab.polarizationReads}">
						<!-- 极化强度-->
					</td>
					<td id="polarizationTolerance" rowspan=4 class=xl6532418  width=64 style='border-top:none;width:48pt' th:text="*{scaletab.polarizationTolerance}">
					</td>
				</tr>
				<tr class="tr_abba" height=20 style='height:15.0pt'>
					<td height=20 class=xl6732418 width=64 style='height:15.0pt;border-top:none;
								border-left:none;width:48pt'>
						B
					</td>
					<td id="read12" class=xl6532418  width=64 style='border-top:none;border-left:none;
								width:48pt'>
					</td>
					<td id="read22" class=xl6532418  width=64 style='border-top:none;border-left:none;
								width:48pt'>
					</td>
					<td class=xl6532418 width=64 style='border-top:none;border-left:none;
								width:48pt'>

					</td>
				</tr>
				<tr class="tr_abba" height=20 style='height:15.0pt'>
					<td height=20 class=xl6732418 width=64 style='height:15.0pt;border-top:none;
								border-left:none;width:48pt'>
						B
					</td>
					<td class=xl6532418 id="read13" width=64 style='border-top:none;border-left:none;
								width:48pt'>
					</td>
					<td class=xl6532418 id="read23" width=64 style='border-top:none;border-left:none;
								width:48pt'>
					</td>
					<td class=xl6532418 width=64 style='border-top:none;border-left:none;
								width:48pt'>
						　
					</td>
				</tr>
				<tr class="tr_abba" height=20 style='height:15.0pt'>
					<td height=20 class=xl6732418 width=64 style='height:15.0pt;border-top:none;
								border-left:none;width:48pt'>
						A
					</td>
					<td class=xl6532418 id="read14" width=64 style='border-top:none;border-left:none;
								width:48pt'>
					</td>
					<td class=xl6532418 id="read24" width=64 style='border-top:none;border-left:none;
								width:48pt'>
					</td>
					<td class=xl6532418 width=64 style='border-top:none;border-left:none;
								width:48pt'>
						　
					</td>
				</tr>

				<tr name="tr_first" class="tr_abba" height=20 style='height:15.0pt'>

					<td rowspan=4 height=80 class=xl6532418 width=64 style='height:60.0pt;
								border-top:none;width:48pt'>
						2
					</td>
					<td rowspan=4 class=xl6532418 width=64 style='border-top:none;width:48pt' th:text="*{detection.smw}" />
					　

					<td class=xl6632418 width=64 style='border-top:none;border-left:none;
								width:48pt'>
						A
					</td>
					<td  id="read31"  class=xl6532418  width=64 style='border-top:none;border-left:none;
								width:48pt'>
					</td>
					<td id="read41" class=xl6532418  width=64 style='border-top:none;border-left:none;
								width:48pt'>
					</td>
					<td class=xl6532418 width=64 style='border-top:none;border-left:none;
								width:48pt'>
						　
					</td>
					<!--分度值-->
					<td  rowspan=4 class=xl6532418 width=61 style='border-top:none;width:46pt'>
						1
					</td>
					<!--相差质量-->
					<td rowspan=4 class=xl6532418  th:text="*{scaletab.differMass}"   width=64 style='border-top:none;width:48pt'>
					</td>
					<!--标准砝码约定质量修正值-->
					<td  th:text="*{scaletab.standardWeightCorrected}" rowspan=4 class=xl6532418  width=64 style='border-top:none;width:48pt'>

					</td>
					<!-- 空气浮力修正值-->
					<td rowspan=4 class=xl6532418   th:text="*{scaletab.airCorrected}" width=64 style='border-top:none;width:48pt'>
					</td>
					<td rowspan=4    th:text="*{scaletab.massCorrected}" class=xl6532418 width=64 style='border-top:none;width:48pt' >
						<!-- 约定质量修正值-->
					</td>
					<td  rowspan=4  th:text="*{scaletab.magneticTolerance}" class=xl6532418  width=64 style='border-top:none;width:48pt'>
					</td>
					<!-- 注释内容 约定值允差-->
					<td  rowspan=4 class=xl6532418  width=64 style='border-top:none;width:48pt'  th:text="*{scaletab.magneticReads}" >
					</td>
					<td   rowspan=4 class=xl6532418 width=64 style='border-top:none;width:48pt' th:text="*{scaletab.massTolerance}">
					</td>
					<td  rowspan=4 class=xl6532418 width=64 style='border-top:none;width:48pt'th:text="*{scaletab.polarizationReads}">
						<!-- 极化强度-->
					</td>
					<td  rowspan=4 class=xl6532418  width=64 style='border-top:none;width:48pt' th:text="*{scaletab.polarizationTolerance}">
					</td>
				</tr>
				<tr class="tr_abba" height=20 style='height:15.0pt'>
					<td height=20 class=xl6732418 width=64 style='height:15.0pt;border-top:none;
								border-left:none;width:48pt'>
						B
					</td>
					<td id="read32" class=xl6532418  width=64 style='border-top:none;border-left:none;
								width:48pt'>
					</td>
					<td id="read42" class=xl6532418  width=64 style='border-top:none;border-left:none;
								width:48pt'>
					</td>
					<td class=xl6532418 width=64 style='border-top:none;border-left:none;
								width:48pt'>

					</td>
				</tr>
				<tr class="tr_abba" height=20 style='height:15.0pt'>
					<td height=20 class=xl6732418 width=64 style='height:15.0pt;border-top:none;
								border-left:none;width:48pt'>
						B
					</td>
					<td class=xl6532418 id="read33" width=64 style='border-top:none;border-left:none;
								width:48pt'>
					</td>
					<td class=xl6532418 id="read43" width=64 style='border-top:none;border-left:none;
								width:48pt'>
					</td>
					<td class=xl6532418 width=64 style='border-top:none;border-left:none;
								width:48pt'>
						　
					</td>
				</tr>
				<tr class="tr_abba" height=20 style='height:15.0pt'>
					<td height=20 class=xl6732418 width=64 style='height:15.0pt;border-top:none;
								border-left:none;width:48pt'>
						A
					</td>
					<td class=xl6532418 id="read34" width=64 style='border-top:none;border-left:none;
								width:48pt'>
					</td>
					<td class=xl6532418 id="read44" width=64 style='border-top:none;border-left:none;
								width:48pt'>
					</td>
					<td class=xl6532418 width=64 style='border-top:none;border-left:none;
								width:48pt'>
						　
					</td>
				</tr>

				<tr name="tr_first" class="tr_abba" height=20 style='height:15.0pt'>

					<td rowspan=4 height=80 class=xl6532418 width=64 style='height:60.0pt;
								border-top:none;width:48pt'>
						3
					</td>
					<td rowspan=4 class=xl6532418 width=64 style='border-top:none;width:48pt' th:text="*{detection.smw}" />
					　

					<td class=xl6632418 width=64 style='border-top:none;border-left:none;
								width:48pt'>
						A
					</td>
					<td  id="read51"  class=xl6532418  width=64 style='border-top:none;border-left:none;
								width:48pt'>
					</td>
					<td id="read61" class=xl6532418  width=64 style='border-top:none;border-left:none;
								width:48pt'>
					</td>
					<td class=xl6532418 width=64 style='border-top:none;border-left:none;
								width:48pt'>
						　
					</td>
					<!--分度值-->
					<td  rowspan=4 class=xl6532418 width=61 style='border-top:none;width:46pt'>
						1
					</td>
					<!--相差质量-->
					<td rowspan=4 class=xl6532418  th:text="*{scaletab.differMass}"   width=64 style='border-top:none;width:48pt'>
					</td>
					<!--标准砝码约定质量修正值-->
					<td  th:text="*{scaletab.standardWeightCorrected}" rowspan=4 class=xl6532418  width=64 style='border-top:none;width:48pt'>

					</td>
					<!-- 空气浮力修正值-->
					<td rowspan=4 class=xl6532418   th:text="*{scaletab.airCorrected}" width=64 style='border-top:none;width:48pt'>
					</td>
					<td rowspan=4    th:text="*{scaletab.massCorrected}" class=xl6532418 width=64 style='border-top:none;width:48pt' >
						<!-- 约定质量修正值-->
					</td>
					<td  rowspan=4  th:text="*{scaletab.magneticTolerance}" class=xl6532418  width=64 style='border-top:none;width:48pt'>
					</td>
					<!-- 注释内容 约定值允差-->
					<td  rowspan=4 class=xl6532418  width=64 style='border-top:none;width:48pt'  th:text="*{scaletab.magneticReads}" >
					</td>
					<td   rowspan=4 class=xl6532418 width=64 style='border-top:none;width:48pt' th:text="*{scaletab.massTolerance}">
					</td>
					<td  rowspan=4 class=xl6532418 width=64 style='border-top:none;width:48pt'th:text="*{scaletab.polarizationReads}">
						<!-- 极化强度-->
					</td>
					<td  rowspan=4 class=xl6532418  width=64 style='border-top:none;width:48pt' th:text="*{scaletab.polarizationTolerance}">
					</td>
				</tr>
				<tr class="tr_abba" height=20 style='height:15.0pt'>
					<td height=20 class=xl6732418 width=64 style='height:15.0pt;border-top:none;
								border-left:none;width:48pt'>
						B
					</td>
					<td id="read52" class=xl6532418  width=64 style='border-top:none;border-left:none;
								width:48pt'>
					</td>
					<td id="read62" class=xl6532418  width=64 style='border-top:none;border-left:none;
								width:48pt'>
					</td>
					<td class=xl6532418 width=64 style='border-top:none;border-left:none;
								width:48pt'>

					</td>
				</tr>
				<tr class="tr_abba" height=20 style='height:15.0pt'>
					<td height=20 class=xl6732418 width=64 style='height:15.0pt;border-top:none;
								border-left:none;width:48pt'>
						B
					</td>
					<td class=xl6532418 id="read53" width=64 style='border-top:none;border-left:none;
								width:48pt'>
					</td>
					<td class=xl6532418 id="read63" width=64 style='border-top:none;border-left:none;
								width:48pt'>
					</td>
					<td class=xl6532418 width=64 style='border-top:none;border-left:none;
								width:48pt'>
						　
					</td>
				</tr>
				<tr class="tr_abba" height=20 style='height:15.0pt'>
					<td height=20 class=xl6732418 width=64 style='height:15.0pt;border-top:none;
								border-left:none;width:48pt'>
						A
					</td>
					<td class=xl6532418 id="read54" width=64 style='border-top:none;border-left:none;
								width:48pt'>
					</td>
					<td class=xl6532418 id="read64" width=64 style='border-top:none;border-left:none;
								width:48pt'>
					</td>
					<td class=xl6532418 width=64 style='border-top:none;border-left:none;
								width:48pt'>
						　
					</td>
				</tr>

				<tr height=19 style='height:14.4pt'>
				</tr>
				<tr height=19 style='height:14.4pt'>
					<td colspan=16 height=19 class=xl6332418 style='height:14.4pt'>
						检定结论:<input id="verdict " name="verdict" class="input_maxx not_border_bottom" style='mso-spacerun:yes'/>
					</td>
				</tr>
				<tr height=19 style='height:14.4pt'>
					<td colspan=1 height=19 class=xl7132418 style='height:14.4pt'>
						检定员:
					</td>
					<td colspan=3 class=xl7132418>
						<div >
							<select name="verifier" th:with="type=${@dict.getType('name')}">
								<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
							</select>
						</div>
					</td>
					<td colspan=1 class=xl7132418>
						核验员:
					</td>
					<td colspan=2 class=xl7132418>
						<div>
							<select name="checkver" th:with="type=${@dict.getType('str')}">
								<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
							</select>
						</div>
					</td>
					<td colspan=5 class=xl7132418  th:text="'检定日期: ' + *{detection.qdtime}">
					</td>
					<td colspan=4 class=xl7132418 >

						有效日期:
						<input id="yxtime " name="yxtime" class=" not_border_bottom" style='mso-spacerun:yes'/>
					</td>
				</tr>
				<tr height=19 style='height:14.4pt'>
					<td colspan=16 height=19 class=xl6332418 style='height:14.4pt'>
						甘肃省计量研究院原始记录，妥善保管。
					</td>
				</tr>
				
				
				<tr height=19 style='height:14.4pt'>
					<td colspan=13 height=20 class=xl6332418 style='height:15.0pt'/>
					<td colspan=3 height=20 class=xl6332418 style='height:15.0pt'>
						　<div class="hidden">
							<!--预制提交值 -->
						<input type="text"  th:value="*{scaletab.read1}" name="read1" id="read1" />
						<input type="text" id="id"  th:value="*{detection.id}"  />
					     </div>
					</td>
				</tr>



			</table>
			</div>
        </div>
    </div>
    <div class="bottom">
        <div class="button-container">
            <button type="submit" class="layui-btn layui-btn-normal layui-btn-sm" lay-submit=""
                    lay-filter="scaletab-save">
                <i class="layui-icon layui-icon-ok"></i>
				提交
            </button>

        </div>
    </div>
	<script type="text/html" id="mpe1-type">


		{{#if (d.mpe1 == E2) { }}
		<span class="layui-badge layui-bg-default-blue">E2  ABBA测试2次</span>

		{{#if (d.mpe1 == F1) { }}
		<span class="layui-badge layui-bg-default-blue">F1  ABBA测一次</span>

		{{#if (d.mpe1 == F2) { }}
		<span class="layui-badge layui-bg-default-blue">F2  ABA测一次</span>

		{{#if (d.mpe1 == M1) { }}
		<span class="layui-badge layui-bg-default-blue">M1  ABA测一次</span>
		{{# } }}
	</script>
	<script type="text/html" id="standardWeightCorrected-type">


		{{#if (d.standardWeightCorrected == { "v1":"10", "v2":"10", "v3":"8","v4": "-1"}) { }}
		<span class="layui-badge layui-bg-default-blue">10KG砝码预定参数</span>

		{{#if (d.standardWeightCorrected == { "v1":"10", "v2":"10", "v3":"8","v4": "-1"}) { }}
		<span class="layui-badge layui-bg-default-blue">20KG砝码预设值</span>
		{{# } }}
	</script>
</form>
<th:block th:include="include :: footer"/>
<script>


    layui.use(['form','table','jquery'], function () {
		let table = layui.table;
		let form = layui.form;
		let $ = layui.jquery;
		let MODULE_PATH = rootPath + "/DetectionController";

		setTdText();
		//保存
		form.on('submit(scaletab-save)', function (data) {
			let loader = layer.load();


			let leitd = document.getElementById('id');
			data.field.id=leitd.value;

			$.ajax({
				url: MODULE_PATH+'/edit',

				data: data.field,
				dataType: 'json',
				contentType: 'application/x-www-form-urlencoded',
				type: 'post',
				success: function (result) {
					if (result.code==200) {
						layer.msg(result.msg, {icon: 1, time: 1000}, function () {
							localStorage.setItem('shouldRefresh', 'true');
							history.back();
						});
					} else {
						layer.msg(result.msg, {icon: 2, time: 1000});
						layer.close(loader);
					}
				}
			})
			return false;
		});

	});


	function setTdText() {
		// 根据 id 获取 td 元素
		const read1 = document.getElementById('read1');
		let myArray = read1.value.split(',');

		for (let k = 0; k < myArray.length; k++) {
			const row = Math.floor(k / 4) + 1; // 计算行号 (1-6)
			const col = (k % 4) + 1;           // 计算列号 (1-4)
			const tdId = `read${row}${col}`;   // 生成ID (read11, read12, ...)

			$(`#${tdId}`).text(myArray[k]);    // 设置对应单元格的文本
		}

		//

	}
</script>
</body>
</html>